package com.zbkj.crmeb.merchant.admin.controller;

import com.common.CommonPage;
import com.crmeb.core.common.CommonResult;
import com.common.PageParamRequest;
import com.zbkj.crmeb.finance.request.FundsMonitorSearchRequest;
import com.zbkj.crmeb.user.response.UserBillResponse;
import com.zbkj.crmeb.user.service.UserBillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;


/**
 * 用户账单表 前端控制器
 */
@Slf4j
@RestController
@RequestMapping("api/admin/mer/user/bill")
@Api(tags = "会员管理 -- 用户账单")
public class MerUserBillController extends AdminBaseController {

    @Autowired
    private UserBillService userBillService;

    @ApiOperation(value = "分页列表")
    @GetMapping(value = "/list")
    public CommonResult<CommonPage<UserBillResponse>>  getList(FundsMonitorSearchRequest request, @Validated PageParamRequest pageParamRequest, HttpServletRequest servletRequest){
        request.setMerId(getMerId(servletRequest));
        CommonPage<UserBillResponse> userBillCommonPage = CommonPage.restPage(userBillService.getListAdmin(request, pageParamRequest));
        return CommonResult.success(userBillCommonPage);
    }

}



